﻿CREATE TABLE [dbo].[t_Loan] (
    [ID]                  INT              IDENTITY (1000000, 1) NOT NULL,
    [DealerSalesPersonID] INT              NOT NULL,
    [DealerMsID]          VARCHAR (50)     NULL,
    [MsID]                VARCHAR (11)     NULL,
    [Ms_CLASS]            AS               (CONVERT([int],left([MsID],(3)),(0))) PERSISTED,
    [Ms_ACCOUNT]          AS               (CONVERT([int],right([MsID],(6)),(0))) PERSISTED,
    [EnterDate]           SMALLDATETIME    NOT NULL,
    [TitleOk]             BIT              NULL,
    [LienHolderOnTitle]   NVARCHAR (128)   NULL,
    [TitleHTML]           NVARCHAR (MAX)   NULL,
    [NameSpace]           NVARCHAR (4000)  NOT NULL,
    [NameSpaceID]         INT              NOT NULL,
    [BreakdownCode]       CHAR (2)         NULL,
    [StatusID]            INT              NOT NULL,
    [StatusDate]          DATETIME         NOT NULL,
    [StatusUser]          VARCHAR (32)     NOT NULL,
    [ContractHolderID]    INT              NOT NULL,
    [DateCreated]         SMALLDATETIME    NOT NULL,
    [ApplicantID]         INT              NULL,
    [CompanyID]           SMALLINT         NOT NULL,
    [GUID_Documents]      UNIQUEIDENTIFIER NOT NULL,
    [GLProgramID]         INT              NULL
);

